package com.zlzkj.app.controller;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import com.zlzkj.core.base.BaseController;
import com.zlzkj.app.model.Form;
import com.zlzkj.app.service.FormService;

/**
 * <strong>设备管理</strong>
 * @since 1.0
 * @version 1.0
 * @author wangrui
 * @see com.zlzkj.app.controller.FormController
 */

@Controller
@RequestMapping(value = "/form")
public class FormController extends BaseController{
	
	@Autowired
	private FormService formService;
	
	@RequestMapping(value = {"/index"})
    public String index(Model model, HttpServletRequest request, HttpServletResponse response, Integer nowPage) {
		if(request.getMethod().equals("POST")){		
			List<Form>list = formService.selectAll();
			return ajaxReturn(response,list);
		}else{
			return "form/index";
		}
    }
	
	@RequestMapping(value = {"/analysis"}, method = RequestMethod.GET)
	public String analysis(Model model, HttpServletRequest request, HttpServletResponse response, Integer nowPage){
		return "analysis/index";
	}

}
